$(function()
{
	$.validator.addMethod("accept",function(value, element, param)
	{
		if(value == '')
			return true;
		return value.match(new RegExp("." + param + "$"));
	}, "Gunakan hanya huruf atau angka saja"
	);
	$("#form_password").validate(
	{
		rules:
		{
			old_password:
			{
				minlength: 5,
				accept: "[a-zA-Z0-9]+"
			},
			new_password:
			{
				required: true,
				minlength: 5,
				accept: "[a-zA-Z0-9]+"
			},
			confirm_password:
			{
				required: true,
				equalTo: "#new_password",
				accept: "[a-zA-Z0-9]+"
			}
		},
		messages:
		{
			old_password:
			{
				minlength: "Old Password minimal terdiri atas 5 karakter"
			},
			new_password:
			{
				required: "New Password wajib diisi",
				minlength: "New Password minimal terdiri atas 5 karakter"
			},
			confirm_password:
			{
				required: "Ketik ulang password di atas",
				equalTo: "Password tidak sama"
			}
		}
	});
});